home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44d.zip / DSIZ@2.QM < prev    next >
Text File  |  1992-04-26  |  5KB  |  90 lines

  1. *                               dsiz@2.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See DSIZxx.QM For Use ]
  4. *                                4/26/92
  5.  
  6. *                             M A C R O
  7. * ----------------------------------------------------------------------
  8. * @(2) Directory Sizes Sorted by Size in Descending Order,
  9. *      LEFT Justify Number of Files' Column
  10. * ----------------------------------------------------------------------
  11. * This macro lists all directories in a current or a specified drive,
  12. * sorted by directory size in descending order.  The number of files in
  13. * each directory is also shown.  The macro can be invoked only at the
  14. * command line, not while editing, by running the batch file dsiz2.bat
  15. * which must be in the path or current directory.
  16.  
  17. *             SYNTAX:   dsiz2 [drive:] <enter>
  18.  
  19. * After the directory list is saved as [drive:]\dsiz.lst and loaded for
  20. * viewing, the temporary file c:\dsiz.ls (no "t" extension) is deleted.
  21.  
  22. * Macro @2 differs from @1 in that it LEFT justifies the number of
  23. * files' column.
  24.  
  25. * Output of dsiz2.bat on my G: drive with @2                    Note
  26. * -------------------------------------------            LEFT Justification
  27. * Volume [G:MINISCRB_2] created: 92-Jan-20 14:34:16;             vvv
  28. * Directory of [g:\qpro\]                     2,214,991 bytes in 54 files
  29. * Directory of [g:\nu\]                       1,882,085 bytes in 45 files
  30. * Directory of [g:\qe\]                       1,400,421 bytes in 81 files
  31. * Directory of [g:\pcplus\]                   1,319,337 bytes in 158 files
  32. * Directory of [g:\slmr\]                       301,762 bytes in 15 files
  33. *                           < Lines omitted >
  34. * Directory of [g:\dos\]                        166,684 bytes in 19 files
  35. * Directory of [g:\pckwik\]                     118,310 bytes in 13 files
  36. * Directory of [g:\]                              2,043 bytes in 1 file
  37. * Directory of [g:\ibm\]                              0 bytes in 1 file
  38. *  14,310,447 bytes in 1,368 files.   15,069,184 bytes allocated (5% slack).
  39.  
  40. *         Contents of dsiz2.bat using @2 in dsiz@2.qm are:
  41. * ┌───────────────────────────────────────────────────────────────────────┐
  42. * │:                            dsiz2.bat                         4/23/92 │
  43. * │:      To run this batch file anywhere, change "Edsiz@2.mac" to:       │
  44. * │:                       "E[d:\path\]dsiz@2.mac"                        │
  45. * │:      where [d:\path\] is [drive:\directory\] for dsiz@2.mac location.│
  46. * │: %1 = Drive with colon.  Uses current drive if %1 is not specified.   │
  47. * │:      Requires DX.EXE (Directory Extended) and Q.EXE in path.         │
  48. * │:      Change c:\ to desired dsiz.ls location, preferably a ram drive. │
  49. * │                                                                       │
  50. * │       @echo off                                                       │
  51. * │       cls                                                             │
  52. * │       DX.EXE %1\ //t/st:1/he:1/at:hsd-/ff/ca:l/out:c:\dsiz.ls         │
  53. * │       Q.EXE c:\dsiz.ls  /Edsiz@2.mac                                  │
  54. * └───────────────────────────────────────────────────────────────────────┘
  55.  
  56. @2              macrobegin setscreenoff savesettings setinsmode
  57.                 setwordwrapmode togglewordwrap cursordown
  58. * --------- Move Directory Size To Line With Directory Name ---------*
  59.     JOINLINE:   cursordown cursordown jfalse AT_EOF
  60.                 unmarkblock markcolumn endline markcolumn
  61.                 cursorup delline
  62.                 cursorup gotocolumn "50" return moveblock
  63.                 endline delltword delltword delltword delltword
  64. * ------------------- Delete Blank Lines After Move ------------------*
  65.                 cursordown delline delline
  66.     AT_EOF:     begline jtrue JOINLINE
  67. * ----------------- Mark Size Block For Descend Sort -----------------*
  68.                 begfile cursordown gotocolumn "50" return
  69.                 unmarkblock markcolumn endfile cursorup markcolumn
  70. * ------------- Descend Sort By Size (From @4 in rfr009.qm) ----------*
  71.                 sort
  72.     AGAIN:      gotoblockend jfalse DELMARK delline
  73.                 gotoblockbeg unkill jump AGAIN
  74. * ------------------ Save File To Drive And Cleanup ------------------*
  75.     DELMARK:    begfile
  76.                 wordright markword copy     * Copy drive letter
  77.                 writeblock
  78.                     begline delch paste     * Insert drive letter
  79.                     endline "t" return      * Write file to [d:]\dsiz.lst
  80.                    "o"                      * In case [d:]\dsiz.lst exists
  81.                 editfile return             * Load [d:]\dsiz.lst
  82.                 nextfile killfile quit      * Kill/quit c:\dsiz.ls
  83.                 restoresettings
  84. *
  85. * 116 bytes Fri  04-05-1991  17:01:02 (TH @2)
  86. * 117 bytes Sun  09-15-1991  14:51:37 (TH @2, for all Qconfig's, v2.15 opt)
  87. * 118 bytes Fri  10-11-1991  12:20:05 (TH @2, QEdit v2.15 required)
  88. *  85 bytes Thu  04-23-1992  08:42:36 (TH @2, changed descend sort routine)
  89.  
  90.